<template>
  <div class="page">
    <!-- 表单 -->

    <a-card>
      <com-vxe-table
        :columns="columns"
        :axios="page"
        :fromItem="fromItem"
        :formData="formData"
        :initialize="initialize"
        @check-view="checkView"
        ref="xTable"
      >
        <template #operate="data">
          <div>
            <vxe-button
              title="查看"
              status="primary"
              content="查看"
              @click="data.callback(data.row)"
            ></vxe-button>
          </div>
        </template>
      </com-vxe-table>
    </a-card>
    <year-model ref="model" width="75vw" height="65vh">
      <template #default="data"> <YregisteredView :params="data.params"></YregisteredView> </template>
      <template #footer> <div></div> </template>
    </year-model>
  </div>
</template>

<script>
// 已登记
import { openMyNdkpJbxx, flowJobPage,scqueryPageList } from "../../api/yearCheck";
import comVxeTable from "@/views/everydayCheck/components/vxe-table/com-vxe-table";
import YearModel from "../../components/yearCheck/year-model.vue";
import { pick } from "../../utils/utils";
import YregisteredView from "../prview/YregisteredView.vue";
export default {
  components: { comVxeTable, YearModel,YregisteredView },
  name: "dengjiPage",
  props:{
    fywflcode: {
      type: String,
      default: "",
    },
  },
  data() {
    return {
      columns: [
        {
          type: "checkbox",
        },
        {
          type: "seq",
          title: "序号",
          width: "60",
        },
        {
          field: "fusermc",
          title: "用户名称",
          width: "150",
        },
        {
          field: "fgzdw",
          title: "工作单位",
          width: "150",
        },
        {
          field: "fyear",
          title: "年度",
          width: "150",
        },
        {
          field: "fzjkssj",
          title: "总结开始时间",
          width: "150",
        },
        {
          field: "fzjjssj",
          title: "总结结束时间",
          width: "150",
        },
        {
          field: "fsftjkh",
          title: "是否提交考核",
          width: "150",
        },

        {
          title: "操作",
          field: "operate",
          width: 200,
          slots: { default: "operate", fixed: "right" },
          fixed: "right"
        },
      ],
      data: [],
      allAlign: null,
      formData: {
        fsxmc: "",
        fqymc: "",
        fslsj: "",
        fjzrq: "",
      },
      fromItem: [
        {
          field: "fyear",
          title: "年度",
          itemRender: {},
          type:'input',
          slots: { default: "name_item" },
        },
        {
          field: "fzjjssj",
          title: "总结开始时间",
          type:'datetime',
          itemRender: {},
          slots: { default: "name_item" },
        },
        {
          field: "fzjkssj",
          title: "总结结束时间",
          itemRender: {},
          type:'datetime',
          slots: { default: "name_item" },
        },
      ],
      page: scqueryPageList,
      initialize: {
        fywflcode: this.fywflcode,
        fsftjkh: "是",
      },
      form: {},
      model: {},
    };
  },
  created() {

  },
  mounted() {

  },

  methods: {
    // 编辑
    checkView(row) {
      openMyNdkpJbxx({ ndkpid: row.id })
        .then((res) => {
          if (res.success) {
            this.$refs.model.handler(res.result);
          } else {
            this.$message.error(res.message);
          }
        })
        .catch((error) => {
          this.$message.error("未知异常");
        });
    },
 
  },
  beforeDestroy() {
    if (this.timeout) clearTimeout(this.timeout);
  }
};
</script>

<style lang="less" scoped>
// @import "../assets/table.less";
@import url("../../assets/table.less");
</style>
